package com.zqx.memento.originalAndMementoAndCaretaker;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;

/**
 * description: 备忘录管理类，即负责人类
 * @author zqx
 * @date 2018/09/04
 */
public class MementoCaretaker {
    //定义一个集合来存储多个备忘录
    private ArrayList<ChessmanMemento> mementos = new ArrayList<ChessmanMemento>();
    private ChessmanMemento memento;

    public ChessmanMemento getMemento(int i) {
        return mementos.get(i);
    }

    public void setMemento(ChessmanMemento memento){
        mementos.add(memento);
    }
}
